using System;
using System.Collections.Generic;
using System.Text;

namespace Avanzis.Helpers.PersistentObjects
{
   public sealed class ThreadScopeInfo : AbstractThreadScopeInfo
	{
		static readonly Object syncObject = new Object();
       [ThreadStatic]
       static Stack<ISessionScope> stack;

       public override Stack<ISessionScope> CurrentStack
		{
			get
			{
				lock (syncObject)
				{
					if (stack == null)
					{
						stack = new Stack<ISessionScope>();
					}

					return stack;
				}
			}
		}
	}
}
